package co.th.helper.jdbc.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import co.th.helper.jdbc.RowMapper;
import co.th.helper.model.RpRating;

public class RpRowMapper extends RowMapper<RpRating>{

	@Override
	public RpRating mapRow(ResultSet resultSet) throws SQLException {
		RpRating rp = new RpRating();
		if (isThere(resultSet, "rp_code"))
			rp.setRpCode(resultSet.getBigDecimal("rp_code"));
		
		if (isThere(resultSet, "rp_name_th"))
			rp.setRpNameTH(resultSet.getString("rp_name_th"));
		
		if (isThere(resultSet, "rp_name_en"))
			rp.setRpNameEN(resultSet.getString("rp_name_en"));
		
		if (isThere(resultSet, "create_by"))
			rp.setCreateBy(resultSet.getString("create_by"));
		
		if (isThere(resultSet, "create_date"))
			rp.setCreateDate(resultSet.getDate("create_date"));
		
		if (isThere(resultSet, "update_by"))
			rp.setUpdateBy(resultSet.getString("update_by"));
		
		if (isThere(resultSet, "update_date"))
			rp.setUpdateDate(resultSet.getDate("update_date"));
		
		return rp;
	}

}
